import org.eclipse.jface.viewers.*;
import org.eclipse.swt.graphics.*;

public class PersonLabelProvider extends LabelProvider implements ITableLabelProvider
{

    public String getColumnText(Object element, int index)
    {
        Person person = (Person) element;
        switch (index)
        {
        case 0:
            return person.firstName;
        case 1:
            return person.lastName;
        case 2:
            return Integer.toString(person.age);
        case 3:
            return Integer.toString(person.children.length);
        default:
            return "unknown " + index;
        }
    }

    public Image getColumnImage(Object arg0, int arg1)
    {
        // TODO Auto-generated method stub
        return null;
    }
}
